Ceci Hermosilla
28/6/2021
The data set of price (in US$) of diamonds have many features, but the the color is a measurement of how the diamond is contaminated with minerals, the range better to worse is D to J. The more pure the color we would expect the more expensive the diamond, since it is more rare. But, is it really like this?
Using plotly package it will be shown:
Loading required package: ggplot2
Attaching package: 'plotly'
The following object is masked from 'package:ggplot2':
last_plot
The following object is masked from 'package:stats':
filter
The following object is masked from 'package:graphics':
layout
Resulting plot:
plot_ly(diamonds,y=diamonds$price,color=diamonds$color,type="box")The price certainly is not influenced by the color, since the most perfect color D has mean prices lower than the worse color J. Other variables like the size of the diamond in carats should be evaluated.